///////////////////////////////////////////////////////////////////////////////
//
//	c64.i
//
//	$Id: SortedList.cpp 29 2011-10-02 23:05:56Z lunarship $
//
//	Labels for Commodore 64.
//	Label names mainly come from the Commodore 64 Programmer's Reference Guide.
//
//-----------------------------------------------------------------------------
//
//	Copyright (C) Simon Collis 2000-2011
//
//	This file is part of a6.
//
//	a6 is free software: you can redistribute it and/or modify it under the
//	terms of the GNU General Public License as published by the Free Software
//	Foundation, either version 3 of the License, or (at your option) any later
//	version.
//
//	a6 is distributed in the hope that it will be useful, but WITHOUT ANY
//	WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
//	FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
//	details.
//
//	You should have received a copy of the GNU General Public License
//	along with a6.  If not, see <http://www.gnu.org/licenses/>.
//
//-----------------------------------------------------------------------------
//
//	0.5.0   First version
//
//////////////////////////////////////////////////////////////////////////////


		.ifndef _C64_I
		.define _C64_I

//		.cpu    6502
				
//////////////////////////////////////////////////////////////////////////////
//
// *** Colours
//
//	C64 Programmers Reference Guide, p451
//
black		= $00
white		= $01
red			= $02
cyan		= $03
purple		= $04
green		= $05
blue		= $06
yellow		= $07
orange		= $08
brown		= $09
ltred		= $0a
darkgrey	= $0b
medgrey		= $0c
ltgreen		= $0d
ltblue		= $0e
ltgrey		= $0f

//////////////////////////////////////////////////////////////////////////////
//
// *** Memory map
//
//      P310 onwards,
//      RS232 extras: P356-358
//

//
// *** Zero page
//

// Constants for R6510 ($0001) (P260)
loram		= 1
hiram		= 2
charen		= 4

//      P310
d6510		= $0000		// 6510 On-Chip Data-Direction Register
r6510		= $0001		// 6510 On-Chip 8-Bit Input/Output Register
adray1		= $0003		// Jump Vector: Convert floating -- integer
adray2		= $0005		// Jump Vector: Convert integer -- floating
charac		= $0007		// Search character
endchr		= $0008		// Flag: scan for quote at end of string
trmpos		= $0009		// Screen column from last TAB
verck		= $000a		// Flag: 0 = Load, 1 = Verify
count		= $000b		// Input buffer pointer / No, of subscripts
dimflg		= $000c		// Flag: default array DIMension
valtyp		= $000d		// Data type: $FF = String, $00 = Numeric
intflg		= $000e		// Data type: $80 = Integer, $00 = Floating
garbfl		= $000f		// Flag: DATA scan/LIST quote/Garbage coll
subflg		= $0010		// Flag: Subscript ref / User function call
inpflg		= $0011		// Flag: $00 = INPUT, $40 = GET, $98 = READ


//      P358
inbit		= $00a7		// RS232: Receiver input bit temp storage
bitci		= $00a8		// RS232: Receiver bit count in
rinone		= $00a9		// RS232: Receiver flag Start bit check
ridata		= $00aa		// RS232: Receiver byte buffer/assembly location
riprty		= $00ab		// RS232: Receiver parity bit storage
bitts		= $00b4		// RS232: Transmitter bit count out
nxtbit		= $00b5		// RS232: Transmitter next bit to be sent
rodata		= $00b6		// RS232: Transmitter byte buffer/disassembly location

//      P357
ribuf		= $00f7		// RS232: Pointer to Receiver Buffer
robuf		= $00f9		// RS232: Pointer to Transmitter Buffer

//
// *** Stack
//


//////////////////////////////////////////////////////////////////////////////
//
// *** $0200 - $02FF
//
m51ctr		= $0293		// RS232: Pseudo 6551 control register
m51cor		= $0294		// RS232: Pseudo 6551 command ergister
m51ajb		= $0295		// RS232: Baud rate for start of bit test
rsstat		= $0296		// RS232: Status register
bitnum		= $0298		// RS232: Number of bits to be sent/received
baudof		= $0299		// RS232: Time of one bit cell
ridbe		= $029b		// RS232: Byte index to end of receiver FIFO buffer
ridbs		= $029c		// RS232: Byte index to start of receiver FIFO buffer
rodbs		= $029d		// RS232: Byte index to start of transmitter FIFO buffer
rodbe		= $029e		// RS232: Byte index to end of transmitter FIFO buffer
enabl		= $02a1		// RS232: Receiver flags


//
// *** Zero page
//

//
// *** Zero page
//

//
// *** Zero page
//

//
// *** User Callable Kernal Routines
//

// P272
cint		= $ff81		// Initialize screen editor
ioinit		= $ff84		// Initialize input/output
ramtas		= $ff87		// Initialize RAM, allocate tape buffer, set screen $0400
restor		= $ff8a		// Restore default I/O vectors
vector		= $ff8d		// Read/set vectored I/O
setmsg		= $ff90		// Control KERNAL messages
second		= $ff93		// Send secondary address after LISTEN
tksa		= $ff96		// Send secondary address after TALK
memtop		= $ff99		// Read/set the top of memory
membot		= $ff9c		// Read/set the bottom of memory
settmo		= $ffa2		// Set timeout on serial bus
ciout		= $ffa8		// Output byte to serial port
acptr		= $ffa5		// Input byte from serial port
unlsn		= $ffae		// Command serial bus to UNLISTEN
listen		= $ffb1		// Command devices on the serial bus to LISTEN
talk		= $ffb4		// Command serial bus device to TALK
readst		= $ffb7		// Read I/O status word
setlfs		= $ffba		// Set logical, first and second addresses
setnam		= $ffbd		// Set file name
open		= $ffc0		// Open a logical file
close		= $ffc3		// Close a specified logical file
chkin		= $ffc6		// Open channel for input
chkout		= $ffc9		// Open channel for output
clrchn		= $ffcc		// Close input and output channels
chrin		= $ffcf		// Input character from channel
chrout		= $ffd2		// Output character to channel
load		= $ffd5		// Load RAM from a device
save		= $ffd8		// Save RAM to device
settim		= $ffdb		// Set real time clock
rdtim		= $ffde		// Read real time clock
stop		= $ffe1		// Scan stop key
getin		= $ffe4		// Get character from keyboard queue
clall		= $ffe7		// Close all channels and files
udtim		= $ffea		// Increment real time clock
screen		= $ffed		// Return X,Y organization of screen
plot		= $fff0		// Read/set X,Y cursor position
iobase		= $fff3		// Returns base address of I/O devices

		.endif
